import { Component } from 'react'
import './App.css';
import Child1 from './components/Child1'
import Child2 from './components/Child2'
class App extends Component {
  constructor() {
    super()
    this.state = {
      title: '张三'
    }
  }
  render() {
    return (
      <div className="App">
        <Child1 title={this.state.title}/>
        <Child2/>
        <button onClick={
          () => {
            this.setState({
              title: '李四'
            })
          }
        }>点击该title</button>
      </div>
    );
  }
}
export default App;
